﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class LoopScaleRectDemo : MonoBehaviour
{
	public List<LoopScaleRectItem.Content> items = new List<LoopScaleRectItem.Content>();
	public RectTransform Content;
	public GameObject ScrollRect;
	private string PrefabName = "UICard";
	static LoopScaleRectDemo _instance;

	void Awake()
	{
		_instance = this;
	}

	public static LoopScaleRectDemo Instance
	{
		get
		{
			return _instance;
		}
	}

	void Start()
	{
		for (int i = 0; i < 50; i++)
			items.Add(new LoopScaleRectItem.Content() { ID = i });

		var loopHorizontalScrollRect = ScrollRect.AddComponent<LoopHorizontalScrollRect>();
		loopHorizontalScrollRect.Init(new LoopHorizontalScrollRect.Content() { m_Content = Content, PrefabName = PrefabName, TotalCount = items.Count,Horizontal = true, Vertical = false });
	}
}
